import { useRef } from "react";
import get from "lodash/get";
import { reloadField, updateField, useForm } from "../context/metadata-context";
import eventBus, { useSubscribe } from "../eventBus";
import request from "../utils/request";

export default function useFieldReloadTrigger(tplData) {

  useSubscribe(reloadField,(field,value)=>{
    //更新字段
    eventBus.publish(updateField+field,value);//更新tplData数据和字段UI
    setTimeout(() => {
      //触发规则
      eventBus.publish("field.blur",field,value)
    }, 0);
 
  },[])
}
